#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=60;
typedef int LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
char str[maxn];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL t;cin>>t;
  while(t--){
    LL n,k;cin>>n>>k;
    memset(str,'\0',sizeof(str));
    for(LL i=1;i<=n;i++) cin>>str[i];
    LL num=0;
    for(LL i=1;i<=n;i++){
        if(str[i]=='*') num++;
    }
    if(num==0){
        cout<<"0"<<"\n";
    }
    else if(num==1){
        cout<<"1"<<"\n";
    }
    else{
        LL ans=0;
        for(LL i=1;i<=n;i++){
            if(str[i]=='*'){
                ans++;str[i]='x';
                break;
            }
        }
        for(LL i=n;i>=1;i--){
            if(str[i]=='*'){
                ans++;str[i]='x';
                break;
            }
        }
        for(LL i=1;i<=n;i++){
            if(str[i]=='x'){
                for(LL j=i+k;j>=i-1;j--){
                    if(str[j]=='x'){
                        i=j+k-1;
                        break;
                    }
                    if(str[j]=='*'){
                        str[j]='x';
                        ans++;
                        i=j-1;
                        break;
                    }
                }
            }
        }
        cout<<ans<<"\n";
    }
  }
return 0;
}
